<?php
require_once 'functions.php';?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>修改用户数据</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">  
	<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <style>
       body{
           
           background: lightblue;
       }
   </style>
</head>
<body>
<?php
    if(!empty($_GET['id'])){
        //连接mysql数据库
        connnetDb();
 
       
        //查找id
        $id=intval($_GET['id']);
        $result=mysql_query("SELECT * FROM usertext WHERE id");
        if(mysql_error()){
            die('can not connect db');
        }
        //获取结果数组
        $result_arr=mysql_fetch_assoc($result);
        // mysql_fetch_assoc是一个计算机函数，
        // 功能是从结果集中取得一行作为关联数组。
        // 返回根据从结果集取得的行生成的关联数组
        // 如果没有更多行，则返回 false。
    }else{
        die('id not define');
    }
?>
 <div class="container">
 <div class="row">
     <dvi class="col-xs-12 col-sm-12 col-md-122" style="text-align:center;font-size:40px;">
         请您将以下数据填写完整再提交
     </div>
</div>
 </div>
 <br/>
 <br/>
 <br/>
<form class="form-horizontal" role="form" action="edituser_server.php" method="post">
    
	<div class="form-group  has-success">
    <label class="col-sm-2"></label>
		<label class="col-sm-2 control-label">用户ID：</label>
		<div class="col-sm-4">
<input class="form-control" name="id" id="focusedInput" type="text"  value="<?php echo $result_arr['id']?>">
		</div>
    </div>
    <div class="form-group  has-success">
    <label class="col-sm-2"></label>
		<label class="col-sm-2 control-label">用户名：</label>
		<div class="col-sm-4">
			<input class="form-control" name="username" id="focusedInput" type="text"  value="<?php echo $result_arr['username']?>">
		</div>
    </div>
    <div class="form-group  has-success">
    <label class="col-sm-2"></label>
		<label class="col-sm-2 control-label">用户密码：</label>
		<div class="col-sm-4">
			<input class="form-control" name="password" id="focusedInput" type="text"  value="<?php echo $result_arr['password']?>">
		</div>
    </div>
    <div class="form-group  has-success">
    <label class="col-sm-2"></label>
		<label class="col-sm-2 control-label">用户性别:</label>
		<div class="col-sm-4">
			<input class="form-control" name="sex" id="focusedInput" type="text"  value="<?php echo $result_arr['sex']?>">
		</div>
    </div>
    <div class="form-group  has-success">
    <label class="col-sm-2"></label>
		<label class="col-sm-2 control-label">用户qq：</label>
		<div class="col-sm-4">
			<input class="form-control" name="qq" id="focusedInput" type="text"  value="<?php echo $result_arr['qq']?>">
		</div>
    </div>
    <div class="form-group  has-success">
    <label class="col-sm-2"></label>
		<label class="col-sm-2 control-label">用户电话：</label>
		<div class="col-sm-4">
			<input class="form-control" name="phone'" id="focusedInput" type="text"  value="<?php echo $result_arr['phone']?>">
        </div>
        </div>
        <div class="form-group  has-success">
        <label class="col-sm-2"></label>
		<label class="col-sm-2 control-label">用户地址</label>
		<div class="col-sm-4">
			<input class="form-control" name="address" id="focusedInput" type="text"  value="<?php echo $result_arr['address']?>">
		</div>
    </div>
    <div class="form-group  has-success">
    <label class="col-sm-2"></label>
		<label class="col-sm-2 control-label">用户邮箱：</label>
		<div class="col-sm-4">
			<input class="form-control" name="email" id="focusedInput" type="text"  value="<?php echo $result_arr['email']?>">
		</div>
	</div>
    </div>
    <div class="form-group  has-success">
    <label class="col-sm-7"></label>
		<div class="col-sm-4">
        <input type="submit" value="提交修改" style=" background: salmon;">
		</div>
	</div>
	</div>
</form>
</body>
</html>
